Python How-To by Yong Cui
Author: Yong Cui [Yong Cui] , Date: September 12, 2023
, Views: 424
8.5.6 Challenge
In section 8.1, we studied how to implement the __init__ method in a custom class. If the subclass has the same implementation as the superclass, you donât need to override __init__ at all. But if you need customized initialization, as in the case of Supervisor, you want to override __init__. How can you override __init__ in the Supervisor class?
Hint Overriding __init__ isnât different from overriding other methods. You use super() to create a proxy object to use the constructor of the superclass.
Copyright Disclaimer:
This site does not store any files on its server. We only index and link
to content provided by other sites. Please contact the content providers
to delete copyright contents if any and email us, we'll remove relevant
links or contents immediately.